package com.xiaohui.gwc.controller;

import com.xiaohui.gwc.mode.Result;
import com.xiaohui.gwc.service.RegiseterService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * @Author: Poppin
 * @Date: 2021/11/30 13:42
 * @Version: 1.0
 */
@RestController
@RequestMapping("/reg")
public class RegisterController {


    RegiseterService regiseterService;


    @Autowired
    public void setRegiseterService(RegiseterService regiseterService) {
        this.regiseterService = regiseterService;
    }


    @GetMapping("/jc")
    public Result Pan(@RequestParam("username")String username){
        return regiseterService.jc(username);

    }
    @PostMapping("/register")
    public Result register(@RequestBody Map<String,String> registerUser){
        return regiseterService.register(registerUser.get("username"),registerUser.get("password"));

    }
}
